org.springframework.web.servlet.mvc.multiaction

Class ParameterMethodNameResolver

    • Method Summary

      Methods 
      Modifier and Type Method and Description
      java.lang.String getHandlerMethodName(HttpServletRequest request)
      Return a method name that can handle this request.
      void setDefaultMethodName(java.lang.String defaultMethodName)
      Set the name of the default handler method that should be used when no parameter was found in the request
      void setLogicalMappings(java.util.Properties logicalMappings)
      Specifies a set of optional logical method name mappings.
      void setMethodParamNames(java.lang.String[] methodParamNames)
      Set a String array of parameter names, where the very existence of a parameter in the list (with value ignored) means that a method of the same name should be invoked.
      void setParamName(java.lang.String paramName)
      Set the name of the parameter whose value identifies the name of the method to invoke.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_PARAM_NAME

        public static final java.lang.String DEFAULT_PARAM_NAME
        Default name for the parameter whose value identifies the method to invoke: "action".
        See Also:
        Constant Field Values
      • logger

        protected final Log logger
      • paramName

        private java.lang.String paramName
      • methodParamNames

        private java.lang.String[] methodParamNames
      • logicalMappings

        private java.util.Properties logicalMappings
      • defaultMethodName

        private java.lang.String defaultMethodName
    • Constructor Detail

      • ParameterMethodNameResolver

        public ParameterMethodNameResolver()
    • Method Detail

      • setParamName

        public void setParamName(java.lang.String paramName)
        Set the name of the parameter whose value identifies the name of the method to invoke. Default is "action".

        Alternatively, specify parameter names where the very existence of each parameter means that a method of the same name should be invoked, via the "methodParamNames" property.

        See Also:
        setMethodParamNames(java.lang.String[])
      • setMethodParamNames

        public void setMethodParamNames(java.lang.String[] methodParamNames)
        Set a String array of parameter names, where the very existence of a parameter in the list (with value ignored) means that a method of the same name should be invoked. This target method name may then be optionally further mapped via the logicalMappings property, in which case it can be considered a logical name only.
        See Also:
        setParamName(java.lang.String)
      • setLogicalMappings

        public void setLogicalMappings(java.util.Properties logicalMappings)
        Specifies a set of optional logical method name mappings. For both resolution strategies, the method name initially comes in from the view layer. If that needs to be treated as a 'logical' method name, and mapped to a 'real' method name, then a name/value pair for that purpose should be added to this Properties instance. Any method name not found in this mapping will be considered to already be the real method name.

        Note that in the case of no match, where the defaultMethodName property is used if available, that method name is considered to already be the real method name, and is not run through the logical mapping.

        Parameters:
        logicalMappings - a Properties object mapping logical method names to real method names
      • setDefaultMethodName

        public void setDefaultMethodName(java.lang.String defaultMethodName)
        Set the name of the default handler method that should be used when no parameter was found in the request